package tk.mybatis.web.webSocket;

import java.util.HashMap;
import java.util.Map;

public class Test1WebSocketPool {
    private static final Map<Test1WebSocket,String> userconnections = new HashMap<>();

    public static void addConnection(Test1WebSocket conn, String tag){
        userconnections.put(conn, tag);
    }
    public static void removeConnection(Test1WebSocket conn){
        userconnections.remove(conn);
    }
    public static void sendMessage(String message){
        userconnections.keySet().forEach(m->m.send(message));
    }
}
